﻿<Window x:Class="ImportWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:xcdg="clr-namespace:Xceed.Wpf.DataGrid;assembly=Xceed.Wpf.DataGrid"
    xmlns:Views="clr-namespace:Xceed.Wpf.DataGrid.Views;assembly=Xceed.Wpf.DataGrid"
    Title="放送局の追加" Width="400" Height="300"
    Icon="../Images/bell-plus_small.png"
    ShowInTaskbar="False">
    <DockPanel Margin="5">
        <Grid DockPanel.Dock="Bottom" HorizontalAlignment="Right">
            <StackPanel Orientation="Horizontal" Margin="0 5 0 0">
                <Button Content="OK" Width="100" IsDefault="True" Click="OkButton_Click" />
                <Button Content="キャンセル" Width="100" Margin="5 0 0 0" IsCancel="True" Click="Cansel_Click" />
            </StackPanel>
        </Grid>
        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
            </Grid.RowDefinitions>
            
            <Grid>
                <xcdg:DataGridControl
                    x:Name="StationsDataGrid"
                    ReadOnly="True"
                    ItemsSource="{Binding ImportedStations}" 
                    AutoCreateColumns="False"
                    NavigationBehavior="RowOrCell"  
                    ItemScrollingBehavior="Immediate">

                    <xcdg:DataGridControl.Columns>
                        <xcdg:Column FieldName="IsSelected" x:Name="IsSelectedColumn"
                             Title="選択"
                             Width="40"
                              />
                        <xcdg:Column FieldName="Id" x:Name="IdColumn"
                             Title="ID"
                             Width="60"
                             />
                        <xcdg:Column FieldName="Name" x:Name="NameColumn"
                             Title="名前"
                             Width="300"
                             />
                    </xcdg:DataGridControl.Columns>
                    <xcdg:DataGridControl.View>
                        <Views:TableView UseDefaultHeadersFooters="False" IsAlternatingRowStyleEnabled="True" VerticalGridLineThickness="1" ShowRowSelectorPane="False">
                            <Views:TableView.FixedHeaders>
                                <DataTemplate>
                                    <xcdg:ColumnManagerRow />
                                </DataTemplate>
                            </Views:TableView.FixedHeaders>
                        </Views:TableView>
                    </xcdg:DataGridControl.View>
                </xcdg:DataGridControl>
            </Grid>
            
            <Grid Grid.Row="1" Margin="0 5 0 0">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto" />
                    <ColumnDefinition />
                    <ColumnDefinition Width="Auto" />
                </Grid.ColumnDefinitions>
                <TextBlock Text="放送局ID:" VerticalAlignment="Center" />
                <TextBox Grid.Column="1" VerticalAlignment="Center" Margin="5 0 5 0" />
                <Button Grid.Column="2" Width="100" Content="追加" VerticalAlignment="Center" />
            </Grid>
            
            <StackPanel Grid.Row="2" Orientation="Horizontal" Margin="0 10 0 0">
                <Button Width="Auto">
                    <StackPanel Orientation="Horizontal" Margin="0">
                        <Image Source="../Images/document-import_small.png" Style="{StaticResource SmallIconStyle}" VerticalAlignment="Center" Margin="5 0 5 0" />
                        <Label Content="インポート(_I)..." VerticalAlignment="Center" Margin="0 0 5 0" Padding="0"
                               ToolTip="以前のニコ生アラートの設定ファイル、またはその他のツールの設定ファイルから放送局をインポートします" />
                    </StackPanel>
                </Button>
            </StackPanel>
        </Grid>
    </DockPanel>
</Window>
